﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;

namespace DataProvider
{
    public class APIDBContext: DbContext
    {
        public DbSet<SageMethod> Methods { get; set; }
        public DbSet<SageField> Fields { get; set; }
        public DbSet<SageVersion> Versions { get; set; }
        public DbSet<SageArgument> Arguments { get; set; }


        //protected override void OnModelCreating(DbModelBuilder modelBuilder)
        //{
        //    base.OnModelCreating(modelBuilder);
        //    modelBuilder.Entity<SageMethod>()
        //        .HasOptional(a => a.Arguments)
        //        .WithOptionalDependent()
        //        .WillCascadeOnDelete(true);
        //    //one-to-many 
        //    //modelBuilder.Entity<SageMethod>()
        //    //    .HasRequired(s => s.Version)
        //    //    .WithMany(s => s.Methods)
        //    //    .HasForeignKey(c => c.VersionId);

        //    //modelBuilder.Entity<SageField>()
        //    //    .HasRequired(s => s.Version)
        //    //    .WithMany(s => s.Fields)
        //    //    .HasForeignKey(c => c.VersionId);

        //}
    }
}
